﻿using System;
using System.Collections.Generic;
using System.Text;

namespace EntityDesigner2
{
    /// <summary>
    /// Json应答器
    /// </summary>
    public class JsonResponse
    {
        /// <summary>
        /// 是否成功
        /// </summary>
        public virtual bool IsSuccessed { get; set; }
        /// <summary>
        /// 消息提示
        /// </summary>
        public virtual string Message { get; set; }
        /// <summary>
        /// 错误
        /// </summary>
        public virtual JsonResponseError Error { get; set; }

        public JsonResponse()
        {
            this.IsSuccessed = true;
        }
    }

    /// <summary>
    /// Json应答器错误信息
    /// </summary>
    public class JsonResponseError
    {
        /// <summary>
        /// 错误码
        /// </summary>
        public int Code { get; set; }
        /// <summary>
        /// 错误错误信息
        /// </summary>
        public string Info { get; set; }
    }

    /// <summary>
    /// Json应答器
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class JsonResponse<T> : JsonResponse
    {
        public virtual T Result { get; set; }
    }
}
